from flask import Flask, request, render_template, json
from MySqlhelper import MySQLHelper

app = Flask(__name__, static_folder="static", template_folder="templates")


@app.route('/register', methods=["get", "post"])
def register():
    conn=MySqlhelper();
    sql="insert into tb_user values (null,%s,%s,%s)"
    i=conn.executeForUCD(sql,[])




# conn = MySQLHelper()
# sql = "insert into tb_user values(null, %s, %s, %s) "
# i = conn.
# print(request.form.__str__())
# print(request.form.get("uname"))


@app.route('/login')
def login():
    print("login")
    return render_template("login.html")


@app.route('/', methods=["get", "post"])
def hello_world():
    str = request.args.__str__()
    print(str)
    print(request.full_path)
    print(request.args.get("upwd"))
    print(request.args.getlist("upwd"))
    print(request.args.get("age", 0))
    print(request.headers)
    print(request.form.__str__())
    print(request.form.get("admin", ""))
    return render_template("index.html")


if __name__ == '__main__':
    app.run()
